package com.lsu.facade.homework;

import java.util.List;

/**
 * 安保系统
 *
 * @Author wang suo
 * @Date 2020/11/26 0026 21:58
 * @Version 1.0
 */
public class SecuritySystem {
    private List<Camera> cameras;
    private List<Light> lights;
    private List<Sensor> sensors;

    public SecuritySystem(List<Camera> cameras, List<Light> lights, List<Sensor> sensors) {
        this.cameras = cameras;
        this.lights = lights;
        this.sensors = sensors;
    }

    public void openAll() {
        for (Camera camera : cameras) {
            camera.open();
        }
        for (Light light : lights) {
            light.open();
        }
        for (Sensor sensor : sensors) {
            sensor.open();
        }
    }
    public void closeAll() {
        for (Camera camera : cameras) {
            camera.close();
        }
        for (Light light : lights) {
            light.close();
        }
        for (Sensor sensor : sensors) {
            sensor.close();
        }
    }
}
